#ifndef _TIMER_H
#define _TIMER_H
#include "thread_pool.h"
#define TIME_NUM 60

struct node{
    int          uid;     // 用户id
    int          peerfd;  // 连接
    struct node* next;
};

struct slot{
    int          size;      // 结点的连接个数
    struct node* head;      // 结点链表
};

typedef struct time_queue{
    struct slot  slot[TIME_NUM];      // 循环队列
    int          current_index;  // 当前指针
}Time_Queue;

Time_Queue* time_queue_init();
void time_queue_destroy(Time_Queue* queue);
void move_next(Time_Queue* queue);
void update_node(Time_Queue* queue, int uid, int peerfd);
void insert_node(Time_Queue* queue, int uid, int peerfd);

#endif
